home *** CD-ROM | disk | FTP | other *** search
/ Sports Illustrated Multimedia Almanac 1995 / Sports Illustrated Multimedia Almanac (1995)(StarPress)[Mac-PC].iso / pc / setup.mst < prev    next >
Text File  |  1995-01-10  |  18KB  |  510 lines

  1. rem rem $$Begin$$
  2.  
  3. rem Copyright:    (c) 1994 StarPress Multimedia. All Rights Reserved.
  4. rem
  5. rem Project:      Sports Illustrated Multimedia Almanac
  6. rem
  7. rem Component:    Installer
  8. rem
  9. rem Description:  Setup script
  10. rem
  11. rem ---------------------------------------------------------------------
  12. rem
  13. rem rem   $Author:   NSJ  $
  14. rem
  15. rem rem     $Date:   12 Jul 1994 15:43:58  $
  16. rem
  17. rem rem     $Log:   S:/almanac.vcs/install/setup.msv  $
  18. rem
  19. rem rem  $Logfile:   S:/almanac.vcs/install/setup.msv  $
  20. rem
  21. rem rem  $Workfile:   setup.mst  $
  22. rem
  23. rem ---------------------------------------------------------------------
  24.  
  25. rem rem $$End$$
  26.  
  27. rem ---------------------------------------------------------------------
  28. rem
  29.  
  30. rem Required to interface with MSSETUP DLL's
  31. rem -------------------------------------------------
  32. '$INCLUDE 'setupapi.inc'
  33. '$INCLUDE 'msdetect.inc'
  34.  
  35. rem Dialog box id's
  36. rem ---------------
  37.     CONST DESTPATH      = 300          ''Gets destination path
  38.     CONST EXITQUIT      = 600          ''Exits on user request
  39.     CONST EXITSUCCESS   = 700          ''Exits when install is done
  40.     CONST ASKSETUP      = 800          ''Gets setup options
  41.     CONST REBOOTWARN    = 900           ''Warn User of impending restart
  42.     CONST REGMSG        = 950           ''Reminder to user to register Product
  43.     CONST QTWLAUNCH        = 1000           ''Tell User how to Launch QTW 2.0 Setup
  44.     CONST QTWWARN        = 1100           ''Allow user to setup QTW 2.0
  45.     CONST TOOBIG        = 6300         ''Not enough space on target disk error
  46.     CONST BADPATH       = 6400         ''Bad destination path error
  47.     CONST BADWINDOWS    = 6500         ''Wrong Windows release
  48.     CONST BADCOLORS     = 6550         ''Not in 256 colors
  49.     CONST EXITFAILURE   = 6600         ''Exits on error
  50.  
  51.  
  52. rem String id's
  53. rem -----------
  54.     CONST STR_UTILITY   = 1024         ''Utility
  55.     CONST STR_GROUP     = 1025         ''Program Manager group
  56.     CONST STR_TITLE     = 1026         ''Installer Title
  57.     CONST STR_MSG1      = 1027         ''Version error message part 1
  58.     CONST STR_MSG2      = 1028         ''Version error message part 2
  59.     CONST STR_WARNING   = 1029         ''Warning
  60.     CONST STR_SIREADME  = 1030         ''SI Read Me
  61.     CONST STR_PROGRAM   = 1031         ''SI Almanac program
  62.     CONST STR_README    = 1032         ''Gallery Read Me
  63.     CONST STR_GALLERY   = 1033         ''Gallery program
  64.     CONST STR_DIAMOND   = 1034         ''Diamond Guide program
  65.  
  66.  
  67. rem Miscellaneous Constants
  68. rem -----------------------
  69.     CONST NOLOGO = 1                   ''Dummy NULL bitmap (must be 1)
  70.     CONST LOGO = 2                     ''Background bitmap
  71.     CONST NOSPACE = 1                  ''No space to complete install
  72.     CONST INSTALLOK = 2                ''Install completed OK
  73.     CONST INSTALLFAILED = 3            ''Install failed for some reason
  74.     CONST UNINSTALLOK = 4              ''Uninstall completed OK
  75.     CONST WM_FONTCHANGE = 29           ''For installing fonts
  76.     CONST HWND_BROADCAST = -1          ''For installing fonts
  77.  
  78.  
  79. rem Global Variables
  80. rem ----------------
  81.     GLOBAL SOURCE$                     ''Source directory
  82.     GLOBAL DEST$                       ''Default destination directory
  83.     GLOBAL MYSYSDIR$                   ''Windows/System directory
  84.     GLOBAL MYWINDIR$                   ''Windows directory
  85.     GLOBAL SETUPTYPE$                  ''Setup type (Local, Client, Server)
  86.     GLOBAL MINIMUMINST$                  ''Setup type (Local, Client, Server)
  87.     GLOBAL PARTIALINST$                ''Setup type (Local, Client, Server)
  88.     GLOBAL OPTIMUMINST$                   ''Setup type (Local, Client, Server)
  89.     GLOBAL QTWDIR$                     ''QTW directory
  90.     GLOBAL CUIDLL$                     ''User interface DLL
  91.     GLOBAL SETUPPATH$                  ''Setup destination path
  92.     GLOBAL HELPPROC$                   ''Help dialog procedure
  93.     GLOBAL EXTRACOSTS$                 ''List of extra costs to add per drive
  94.     GLOBAL APPNEEDS$                   ''Disk space costs per drive
  95.     GLOBAL SECTIONKEY$                 ''INF file section key
  96.     GLOBAL SUCCESS%                    ''Installation completion code
  97.  
  98.  
  99. rem Initialize global vriables
  100. rem --------------------------
  101.     MINIMUMINST$    = "MIN"
  102.     OPTIMUMINST$    = "OPT"
  103.     SETUPTYPE$        = MINIMUMINST$
  104.     SETUPPATH$      = "C:\SI1995"
  105.     SOURCE$         = GetSymbolValue("STF_SRCDIR")
  106.     DEST$           = SETUPPATH$
  107.     SUCCESS%        = INSTALLFAILED
  108.     EXTRACOSTS$     = "ExtraCosts"
  109.     APPNEEDS$       = "AppNeeds"
  110.     SECTIONKEY$     = "SectionKey"
  111.  
  112.     FOR i% = 1 TO 26 STEP 1
  113.         AddListItem EXTRACOSTS$, "16384"
  114.     NEXT i%
  115.  
  116.  
  117. rem Get name of localized user interface dialogs
  118. rem --------------------------------------------
  119.     CUIDLL$ = "setup.DLL"
  120.  
  121.  
  122. rem Subroutines and Functions
  123. rem -------------------------
  124.     DECLARE FUNCTION Install (Level$) AS INTEGER
  125.     DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  126.     DECLARE FUNCTION GetDLLVersion LIB "setup.dll" (szDLL$) AS INTEGER
  127.     DECLARE FUNCTION HideCriticalDirectory LIB "setup.dll" (szDir$) AS INTEGER
  128.     DECLARE FUNCTION Has256Colors LIB "setup.dll" (hinst%) AS INTEGER
  129.     DECLARE FUNCTION GetResourceString LIB "setup.dll" (szResource$, idString%) AS INTEGER
  130.     DECLARE FUNCTION StartCustomSetup LIB "setup.dll" (hinst%, hwnd%) AS INTEGER
  131.     DECLARE FUNCTION StopCustomSetup LIB "setup.dll" (hinst%, hwnd%) AS INTEGER
  132.     DECLARE FUNCTION MyAddFont LIB "setup.dll" (szFontName$) AS INTEGER
  133.     DECLARE FUNCTION CreateScalableFontResource LIB "GDI.EXE" (fHidden%, FOTFile$, TTFFile$, SystemDir$) AS INTEGER
  134.     DECLARE FUNCTION AddFontResource LIB "GDI.EXE" (FOTFile$) AS INTEGER
  135.     DECLARE FUNCTION SendMessage LIB "USER.EXE" (hWnd%, Message%, wParam%, lParam&) AS LONG
  136.     DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
  137.     DECLARE FUNCTION WinExec LIB "KERNEL" (cmdLine$, fuCmdShow%) AS INTEGER
  138.  
  139. rem Initialize custom setup logic
  140. rem -----------------------------
  141. rem SetBitmap CUIDLL$, NOLOGO
  142.     i% = GetResourceString (CUIDLL$, STR_TITLE)
  143.     SetTitle GetSymbolValue ("ResourceString")
  144.     i% = StartCustomSetup (HinstFrame(), HwndFrame ())
  145.     i% = SetBeepingMode(1)
  146.  
  147.  
  148. rem Make sure that we are running on Windows 3.1 or better
  149. rem ------------------------------------------------------
  150.     IF GetWindowsMajorVersion() < 3 THEN
  151.        sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", 0, "")
  152.        UIPop 1
  153.        GOTO CLEANUP
  154.     END IF
  155.  
  156.     IF (GetWindowsMajorVersion() = 3) AND (GetWindowsMinorVersion() < 10) THEN
  157.        sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", 0, "")
  158.        UIPop 1
  159.        GOTO CLEANUP
  160.     END IF
  161.  
  162.  
  163. rem Make sure that we are running on a 386 or better
  164. rem ------------------------------------------------
  165.     IF GetWinFlags() AND 2 THEN
  166.        sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", 0, "")
  167.        UIPop 1
  168.        GOTO CLEANUP
  169.     END IF
  170.  
  171. rem Determine if QTW 2.0 is installed
  172. rem ---------------------------------
  173. exist%=0
  174. exist%=DoesFileExist(MYSYSDIR$+"QTNOTIFY.EXE",femExists)
  175. version$="0"
  176. IF exist% then
  177.     version$=GetVersionOfFile(MYSYSDIR$+"QTNOTIFY.EXE")
  178. END IF    
  179.  
  180. IF exist%=0 then
  181.     sz$=UIStartDlg(CUIDLL$,QTWWARN,"FRadioDlgProc",0,"")    
  182. else 
  183.     if mid$(version$,1,1) <> "2" then
  184.         sz$=UIStartDlg(CUIDLL$,QTWWARN,"FRadioDlgProc",0,"")        
  185.     end if
  186. end if
  187.  
  188. if sz$="EXIT" then
  189.     UIPop 1
  190.     sz$=UIStartDlg(CUIDLL$,QTWLAUNCH,"FRadioDlgProc",0,"")
  191.     GOTO CLEANUP
  192. else
  193.     UIPop 1
  194. END IF
  195.  
  196.  
  197. rem Find and read the .INF file
  198. rem ---------------------------
  199.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  200.  
  201.     IF szInf$ = "" THEN
  202.        szTemp$ = GetSymbolValue("STF_SRCDIR")
  203.        szInf$ = szTemp$ + "ALMANAC.INF"
  204.     END IF
  205.  
  206.     ReadInfFile szInf$
  207.  
  208.  
  209. rem Estimate the cost of the install
  210. rem --------------------------------
  211.     ListSym$ = APPNEEDS$
  212.     drive$ = MID$("C:\", 1, 1)
  213.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  214.     AddSectionFilesToCopyList "Almanac", SOURCE$, "C:\"
  215.     ClearCopyList
  216.  
  217. rem Get the setup type
  218. rem ----------------------------------------
  219. ITYPE:
  220.     rem SetSymbolValue "RadioDefault", SETUPTYPE$
  221.  
  222. ITYPEL1:
  223.     sz$ = UIStartDlg(CUIDLL$, ASKSETUP, "FRadioDlgProc", 0, "")
  224.  
  225.     rem SETUPTYPE$ = GetSymbolValue("ButtonChecked")
  226.  
  227.     IF sz$ = "CONTINUE" THEN
  228.         SETUPTYPE$=OPTIMUMINST$
  229.        UIPop 1
  230.  
  231.     ELSEIF sz$ = "CANCEL" THEN
  232.         SETUPTYPE$=MINIMALINST$
  233.         UIPop 1
  234.  
  235.     ELSE
  236.        GOSUB ASKQUIT
  237.        GOTO ITYPE
  238.  
  239.     END IF
  240.  
  241. if SETUPTYPE$=MINIMALINST$ then 
  242.     GOTO INSTALL
  243. END IF
  244.  
  245. rem Get the destination path; if it's bad, display an error
  246. rem ----------------------------------------------------------------
  247. GETPATH:
  248.     SetSymbolValue "EditTextIn", DEST$
  249.     SetSymbolValue "EditFocus", "END"
  250.  
  251. GETPATHL1:
  252.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", 0, "")
  253.  
  254.     DEST$ = GetSymbolValue("EditTextOut")
  255.  
  256.     IF sz$ = "CONTINUE" THEN
  257.        IF IsDirWritable(DEST$) = 0 THEN
  258.           GOSUB BADPATH
  259.           GOTO GETPATHL1
  260.        END IF
  261.  
  262.        UIPop 1
  263.  
  264.     ELSEIF sz$ = "REACTIVATE" THEN
  265.        GOTO GETPATHL1
  266.  
  267.     ELSE
  268.        GOSUB ASKQUIT
  269.        GOTO GETPATH
  270.  
  271.     END IF
  272.  
  273. rem Perform actual installation
  274. rem ---------------------------
  275. INSTALL:
  276.     SUCCESS% = Install(SETUPTYPE$)
  277.  
  278.     IF SUCCESS% = NOSPACE THEN
  279.        GOSUB TOOBIG
  280.        GOTO GETPATH
  281.     END IF
  282.  
  283. rem De-installation completed
  284. rem -------------------------
  285. UNINSTALLED:
  286.  
  287. rem When done, issue dialog
  288. rem -----------------------
  289. QUIT:
  290.     IF SUCCESS% = INSTALLOK THEN
  291.     rem Remind User about Registering Product
  292.     sz$ = UIStartDlg(CUIDLL$, REGMSG, "FInfo0DlgProc", 0, "")
  293.     UIPop 1
  294.     rem Restart Windows 
  295.     sz$ = UIStartDlg(CUIDLL$, REBOOTWARN, "FInfo0DlgProc", 0, "")
  296.     '   Check if any files were locked during install.  If the RestartList
  297.     '   is not empty, ExitExecRestart() will restart Windows, cleanup setup
  298.     '   files, and copy over locked files before Windows restarts.
  299.     i% = RestartListEmpty()
  300.     IF i% = 0 THEN
  301.     '      ExitExecRestart() only returns if applications refuse to be shutdown.
  302.     '      Win32s is installed but will not operate until Windows is restarted
  303.     '      and the Win32s VxD is loaded.
  304.         i% = ExitExecRestart()
  305.     ELSE
  306.     '      If the RestartList list is empty, it is necessary to restart windows
  307.     '      directly.  The MSSETUP program creates _MSRSTRT.EXE and _MSSETUP.BAT
  308.     '      in the restart directory.  This program should be exec'd to handle
  309.     '      proper MSSETUP cleanup (temp files) and restart Windows.
  310.         i% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
  311.     ENDIF
  312.     
  313.     ELSEIF SUCCESS% = UNINSTALLOK THEN
  314.        sz$ = UIStartDlg(CUIDLL$, EXITDEINSTOK, "FInfo0DlgProc", 0, "")
  315.     ELSE
  316.        sz$ = UIStartDlg(CUIDLL$, EXITFAILURE, "FInfo0DlgProc", 0, "")
  317.     END IF
  318.     UIPop 1
  319.     
  320. rem Clean up all processing
  321. rem -----------------------
  322. CLEANUP:
  323.     i% = StopCustomSetup (HinstFrame(), HwndFrame ())
  324.     END
  325.  
  326.  
  327. rem ASKQUIT: The user requested quit; does (s)he really want to?
  328. rem ------------------------------------------------------------
  329. ASKQUIT:
  330.     sz$ = UIStartDlg(CUIDLL$, EXITQUIT, "FInfoDlgProc", 0, "")
  331.     UIPop 1
  332.     IF sz$ = "CONTINUE" THEN
  333.        RETURN
  334.     END IF
  335.     GOTO CLEANUP
  336.  
  337.  
  338. rem BADPATH: The user entered an invalid destination directory
  339. rem ----------------------------------------------------------
  340. BADPATH:
  341.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  342.     IF sz$ = "REACTIVATE" THEN
  343.        GOTO BADPATH
  344.     END IF
  345.     UIPop 1
  346.  
  347.     RETURN
  348.  
  349.  
  350. rem TOOBIG: The source files won't fit on the requested destination disk
  351. rem --------------------------------------------------------------------
  352. TOOBIG:
  353.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  354.     IF sz$ = "REACTIVATE" THEN
  355.        GOTO TOOBIG
  356.     END IF
  357.     UIPop 1
  358.  
  359.     RETURN
  360.  
  361. rem Install: Perform actual installation
  362. rem ------------------------------------
  363. FUNCTION Install (Level$) STATIC AS INTEGER
  364.  
  365.     rem Create the destination directory
  366.     rem --------------------------------
  367.         IF Level$=OPTIMUMINST$ then 
  368.             CreateDir DEST$, cmoNone
  369.         END IF
  370.  
  371.     rem Determine the Windows\System directory
  372.     rem --------------------------------------
  373.         MYSYSDIR$ = GetWindowsSysDir
  374.  
  375.     rem Build the copy list
  376.     rem -------------------
  377.         if Level$=OPTIMUMINST$ then 
  378.             AddSectionFilesToCopyList "Almanac", SOURCE$, DEST$
  379.         END IF
  380.         AddSectionFilesToCopyList "Fonts", SOURCE$, MYSYSDIR$
  381.  
  382.     rem Check that we have enough free space to perform the install
  383.     rem -----------------------------------------------------------
  384.         ListSym$ = APPNEEDS$
  385.         StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  386.  
  387.         drive$ = MID$(DEST$, 1, 1)
  388.         ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  389.         cost& = VAL(GetListItem(APPNEEDS$, ndrive%))
  390.         free& = GetFreeSpaceForDrive(drive$)
  391.  
  392.         IF cost& >= free& THEN
  393.            Install = NOSPACE
  394.            EXIT FUNCTION
  395.         END IF
  396.  
  397.     rem Copy all the files from the source to the destination
  398.     rem -----------------------------------------------------
  399.         CopyFilesInCopyList
  400.  
  401.     rem Create a Program Manager group and appropriate items
  402.     rem ----------------------------------------------------
  403.         i% = GetResourceString (CUIDLL$, STR_GROUP)
  404.         GROUP$ = GetSymbolValue ("ResourceString")
  405.         CreateProgmanGroup GROUP$, "", cmoNone
  406.  
  407.         i% = GetResourceString (CUIDLL$, STR_PROGRAM)
  408.         IF Level$=OPTIMUMINST$ then
  409.             CreateProgmanItem GROUP$, GetSymbolValue ("ResourceString"), MakePath(DEST$,"almanac.exe"), "", cmoOverwrite
  410.         else
  411.             CreateProgmanItem GROUP$, GetSymbolValue ("ResourceString"), MakePath(SOURCE$,"almanac\almanac.exe"), "", cmoOverwrite
  412.         END IF
  413.         i% = GetResourceString (CUIDLL$, STR_SIREADME)
  414.         CreateProgmanItem GROUP$, GetSymbolValue ("ResourceString"), MakePath(SOURCE$,"almanac\sireadme.wri"), "", cmoOverwrite
  415.  
  416.         i% = GetResourceString (CUIDLL$, STR_GALLERY)
  417.         CreateProgmanItem GROUP$, GetSymbolValue ("ResourceString"), MakePath(SOURCE$,"almanac\gallery.exe"), "", cmoOverwrite
  418.  
  419.         i% = GetResourceString (CUIDLL$, STR_README)
  420.         CreateProgmanItem GROUP$, GetSymbolValue ("ResourceString"), MakePath(SOURCE$,"almanac\readme.wri"), "", cmoOverwrite
  421.  
  422.         i% = GetResourceString (CUIDLL$, STR_DIAMOND)
  423.         CreateProgmanItem GROUP$, GetSymbolValue ("ResourceString"), MakePath(SOURCE$,"almanac\diamond.exe"), "", cmoOverwrite
  424.  
  425.  
  426.         CreateProgmanItem GROUP$, "Quicktime for Windows 2.0 Installer", MakePath(SOURCE$,"QTW20\setup.exe"), "", cmoOverwrite
  427.  
  428.     rem Add our fonts
  429.     rem -------------
  430.  
  431.     rem This one is non-TrueType, the rest are
  432.     rem --------------------------------------
  433.         i% = MyAddFont (MakePath(DEST$,"sitables.fon"))
  434.         CreateIniKeyValue "WIN.INI", "fonts", "SI Tables (VGA res)", "SITABLES.FON", cmoOverwrite
  435.  
  436.         i% = CreateScalableFontResource (0, MYSYSDIR$ + "SI_HEA.FOT", "SI_HEA.TTF", MYSYSDIR$)
  437.         i% = AddFontResource (MYSYSDIR$ + "SI_HEA.FOT")
  438.         FontName$ = STRING$ (64, 32)
  439.         i% = GetTypeFaceNameFromTTF (MYSYSDIR$ + "SI_HEA.TTF", FontName$, 64)
  440.         CreateIniKeyValue "WIN.INI", "fonts", FontName$ + " (TrueType)", "SI_HEA.FOT", cmoOverwrite
  441.  
  442.         i% = CreateScalableFontResource (0, MYSYSDIR$ + "SI_MID.FOT", "SI_MID.TTF", MYSYSDIR$)
  443.         i% = AddFontResource (MYSYSDIR$ + "SI_MID.FOT")
  444.         FontName$ = STRING$ (64, 32)
  445.         i% = GetTypeFaceNameFromTTF (MYSYSDIR$ + "SI_MID.TTF", FontName$, 64)
  446.         CreateIniKeyValue "WIN.INI", "fonts", FontName$ + " (TrueType)", "SI_MID.FOT", cmoOverwrite
  447.  
  448.         i% = CreateScalableFontResource (0, MYSYSDIR$ + "HELVETIC.FOT", "HELVETIC.TTF", MYSYSDIR$)
  449.         i% = AddFontResource (MYSYSDIR$ + "HELVETIC.FOT")
  450.         FontName$ = STRING$ (64, 32)
  451.         i% = GetTypeFaceNameFromTTF (MYSYSDIR$ + "HELVETIC.TTF", FontName$, 64)
  452. rem     CreateIniKeyValue "WIN.INI", "fonts", FontName$ + " (TrueType)", "HELVETIC.FOT", cmoOverwrite
  453. rem     The following is a workaround since GetTypeFaceNameFromTTF doesnt work and
  454. rem     Microsoft can't explain why for this font. It does work for SI_HEA.TTF.
  455.         CreateIniKeyValue "WIN.INI", "fonts", "Helvetica" + " (TrueType)", "HELVETIC.FOT", cmoOverwrite
  456.  
  457.         i% = CreateScalableFontResource (0, MYSYSDIR$ + "TIMES__0.FOT", "TIMES__0.TTF", MYSYSDIR$)
  458.         i% = AddFontResource (MYSYSDIR$ + "TIMES__0.FOT")
  459.         FontName$ = STRING$ (64, 32)
  460.         i% = GetTypeFaceNameFromTTF (MYSYSDIR$ + "TIMES__0.TTF", FontName$, 64)
  461. rem     CreateIniKeyValue "WIN.INI", "fonts", FontName$ + " (TrueType)", "TIMES__0.FOT", cmoOverwrite
  462. rem     The following is a workaround since GetTypeFaceNameFromTTF doesnt work and
  463. rem     Microsoft can't explain why for this font. It does work for SI_HEA.TTF.
  464.         CreateIniKeyValue "WIN.INI", "fonts", "Times Roman" + " (TrueType)", "TIMES__0.FOT", cmoOverwrite
  465.  
  466.         i% = SendMessage (HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
  467.  
  468.  
  469.     rem Save Paths when program installed to HD
  470.     rem ---------------------------------------
  471.  
  472.     rem Check for \ at end of path
  473.     REM --------------------------
  474.         if Level$=OPTIMUMINST$ then
  475.             if mid$(SOURCE$,len(SOURCE$),1) <> "\" then
  476.                 SOURCE$=SOURCE$+"\"
  477.             end if
  478.             if mid$(DEST$,len(DEST$),1) <> "\" then 
  479.                 DEST$=DEST$+"\"
  480.             end if
  481.             CreateIniKeyValue (DEST$ + "SI.INI"), "DRIVES", "CDPATH", SOURCE$+"ALMANAC\", cmoOverwrite
  482.         END IF
  483.  
  484.     rem Indicate install completed OK
  485.     rem -----------------------------
  486.         Install = INSTALLOK
  487.  
  488. END FUNCTION
  489.  
  490. rem MakePath: Builds path from directory and file
  491. rem ---------------------------------------------
  492. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  493.  
  494.     IF szDir$ = "" THEN
  495.        MakePath = szFile$
  496.  
  497.     ELSEIF szFile$ = "" THEN
  498.        MakePath = szDir$
  499.  
  500.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  501.        MakePath = szDir$ + szFile$
  502.  
  503.     ELSE
  504.        MakePath = szDir$ + "\" + szFile$
  505.  
  506.     END IF
  507.  
  508. END FUNCTION
  509.  
  510.